<extend name="Public:innerbase" />
<block name="css">
<link type="text/css" rel="stylesheet" href="{:STATICS}/pnotify/pnotify.custom.min.css" />
<style>
	.table-toolbar{
		margin:10px 0;
	}
</style>
</block>
<block name="content">
	<div class="container-fluid">
		<div class="page-header wm-page-header">
			<h3>粉丝列表</h3>
		</div>
		<form class="form-inline" action="__SELF__" style="margin-bottom:20px;">
			<fieldset>
				<label class="control-label">粉丝渠道</label>
				<select class="form-control" name="scene_id" id="scene">
					<option value="0">全部</option>
					<volist name="scene_list" id="scene">
					<option value="{$scene.scene_id}" <eq name="scene.scene_id" value="$_GET['scene_id']">selected</eq>>{$scene.scene_name}</option>
					</volist>
				</select>
				<button type="submit" class="btn btn-default">查找</button>
				<button type="button" id="sync" class="btn btn-warning" data-backdrop="static" data-toggle="modal" data-target="#editModal">同步数据</button>
			</fieldset>
		</form>
		<table class="table wm-table-bordered table-striped table-hover">
			<tbody>
				<volist name="list" id="vo">
				<tr data-link-bind="{$vo.id}">
					<td><img src="{$vo.headimgurl}46" />{$vo.wechat_name}</td>
					<td><?php echo $vo['country'].$vo['province'].$vo['city']?></td>
				</tr>
				</volist>
			</tbody>
		</table>
		<div>{$page}</div>
	</div>
	<div class="modal fade" id="editModal" role="dialog">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-body">
					<i class="fa fa-lg fa-spinner fa-spin"></i>&nbsp;正在同步数据，请稍候...
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</block>
<block name="js">
<script src="{:STATICS}/pnotify/pnotify.custom.min.js"></script>
<script>
$(function(){
	$('#sync').click(function(){
		$.ajax({
			url: "{:U('user_sync1')}",
			success:function(data){
				if(data.status==0){
					new PNotify({
						text: data.message,
						type: 'success'
					});
					$('#editModal').modal('hide');
					location.reload();
				}
				else{
					new PNotify({
						text: data.message,
						type: 'error'
					});
				}
			},
			dataType:'json',
			type:'get'
		});
	});
})
</script>
</block>